﻿Imports System.Xml.Linq

Public Class Photo
    Private _thumbnail As String
    Private _image As String

    Public Property ThumbnailUrl() As String
        Get
            Return _thumbnail
        End Get
        Set(ByVal value As String)
            _thumbnail = value
        End Set
    End Property

    Public Property ImageUrl() As String
        Get
            Return _image
        End Get
        Set(ByVal value As String)
            _image = value
        End Set
    End Property

    Public Sub New(ByVal ele As XElement)
        Dim thumbUrl As String
        ' see if thumbnail exists
        Dim thumb As String = ele.Attribute("thumbnail")
        If thumb IsNot Nothing Then
            thumbUrl = thumb
        Else
            thumbUrl = ele.Value
        End If
        _thumbnail = thumbUrl
        _image = ele.Value
    End Sub

    Public Sub New(ByVal thumbUrl As String, ByVal imageUrl As String)
        _thumbnail = thumbUrl
        _image = imageUrl
    End Sub
End Class


